home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / Winter Shell 1.0d2 / Source / Libraries / PatchLib / PatchLib.h < prev   
Encoding:
C/C++ Source or Header  |  1994-01-14  |  1.0 KB  |  31 lines  |  [TEXT/KAHL]

  1. #pragma once
  2.     
  3. #include "TrapLib.h"
  4.  
  5. /* use these typedefs when calculating argument and return value sizes */
  6. typedef short PatchBooleanParameter;
  7. typedef short PatchCharParameter;
  8. typedef short PatchByteParameter;
  9.  
  10. /* data needed by a patch */
  11. typedef struct PatchType {
  12.     struct PatchType *next;        /* next patch */
  13.     pascal void (*addr)(...);    /* address of patch routine */
  14.     pascal void    (*trap)(...);    /* saved trap address */
  15.     long            argsize;            /* size of arguments */
  16.     long            retsize;            /* size of return value */
  17.     short            num;                /* number of trap */
  18.     TrapType        type;                /* type of trap */
  19.     Boolean        skip;                /* if true, skip trap */
  20.     Boolean        installed;        /* true if patch was installed */
  21.     long            globalreg;        /* value of global variable base register */
  22.     void            *data;            /* application defined data */
  23.     /* ... followed by code to execute patch ... */
  24. } PatchType;
  25.  
  26. void PatchInstall(PatchType *patch);
  27. void PatchRemove(PatchType *patch);
  28. PatchType *PatchBegin(void *addr, short num,
  29.     long argsize, long retsize, void *data);
  30. void PatchEnd(PatchType *patch);
  31.